﻿@model IEnumerable<Asset_Management.Models.Provider>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            ProviderID
        </th>
        <th>
            @Html.ActionLink("ProviderName", "Index", new { sortOrder=ViewBag.NameSortParm })
        </th>
        <th>
            @Html.ActionLink("Address", "Index", new {sortOrder = ViewBag.AdressSortParm})
        </th>
        <th>
            @Html.ActionLink("Phone", "Index", new {sortOrder = ViewBag.PhoneSortParm})
        </th>
        <th>
            @Html.ActionLink("Manager", "Index", new {sortOrder = ViewBag.ManagerSortParm})
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td> 
            @Html.DisplayFor(modelItem => item.ProviderID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProviderName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Address)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Manager)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ProviderID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ProviderID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ProviderID })
        </td>
    </tr>
}

</table>
